package com.cxk.hr.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cxk.hr.dao.EmployeeMapper;
import com.cxk.hr.dao.HistoryMapper;
import com.cxk.hr.pojo.Employee;
import com.cxk.hr.pojo.History;
import com.cxk.hr.service.HistoryService;

@Service("historyService")
public class HistoryServiceImpl implements HistoryService {
	@Resource
	private EmployeeMapper employeeMapper;
	@Resource
	private HistoryMapper historyMapper;

	@Override
	public List<History> selectRetireList(Integer pageNo, Integer pageSize) {
		List<History> histories = historyMapper.selectRetireList(pageNo, pageSize);
		return histories;
	}

	@Override
	public History selectHistoryById(Integer id) {
		History history = historyMapper.selectHistoryById(id);
		return history;
	}

	@Override
	public List<History> selectList(Integer pageNo, Integer pageSize) {
		List<History> histories = historyMapper.selectList(pageNo, pageSize);
		return histories;
	}

	@Override
	public History selectByNumber(Integer employeeNumber) {
		History history = historyMapper.selectByNumber(employeeNumber);
		return history;
	}

	@Override
	public Integer updateById(History history) {
		Integer isUpdate = historyMapper.updateById(history);
		return isUpdate;
	}

	@Override
	public Integer updateHistoryByEmployee(Employee employee,String status) {
		Integer isUpdate = historyMapper.updateHistoryByEmployee(employee,status);
		return isUpdate;
	}

}
